<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link href="/webjars/bootstrap/3.3.7/css/bootstrap.css" rel="stylesheet">
    <script type="text/javascript" src="webjars/vue/2.6.10/dist/vue.js"></script>
    <script type="text/javascript" src="/webjars/axios/0.19.0/dist/axios.js"></script>
    <script type="text/javascript" src="/webjars/jquery/3.4.1/jquery.slim.js"></script>
    <script src="webjars/jquery-cookie/1.4.1-1/jquery.cookie.js"></script>
</head>
<style>
    .btn-style {
        margin: 5px;
    }
</style>
<body>
<div class="container">
    <div id="vuebox">
        <div class="text-center"><h3>常见问题检索</h3></div>
        <table class="table table-striped">
           <tr>
               <td>分类</td>
               <td>{{id}}</td>
           </tr>
            <tr>
                <td>添加时间</td>
                <td>{{createDate}}</td>
            </tr>
            <tr>
                <td>标题</td>
                <td>{{title}}</td>
            </tr>
            <tr>
                <td>内容</td>
                <td>{{content}}</td>
            </tr>
        </table>
        <div class="form-group text-center">
            <button type="button"  class="btn btn-primary" @click="back()">返回</button>
        </div>
    </div>
</div>
</body>
<script>

</script>
<script>
    var vm = new Vue({
        el: "#vuebox",
        data: {
            mydata: {},
            id:sessionStorage.getItem("id"),
            createDate:"",
            content:"",
            title:"",
            cname:""
        },
        mounted() {
            axios.get("/select", {params: {title: this.title}}).then(res => this.mydata = res.data);
            var id =sessionStorage.getItem("id")
            console.log(id)
            this.getEntryById(id)
        },
        methods: {
            getEntryById:function (id) {
                axios.get("/faqsById", {params: {id: this.id}}).then(res => {
                    this.mydata=res.data
                    this.title=res.data.faqss.title
                    this.createDate=res.data.faqss.createDate
                    this.content=res.data.faqss.content
                    this.id=res.data.faqss.id
                });
            },
            back:function () {
                window.location.replace("/list.html")
            }
        }

    })
</script>
</html>